﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
//using OrchardCore.Data.Migration;
using OrchardCore.Modules;
using Ruitu.Edu.TrainingDemo.Drivers;
using Ruitu.Edu.TrainingDemo.Models;
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement;
using OrchardCore.Data;
using Ruitu.Edu.TrainingDemo.Indexes;
using OrchardCore.Data.Migration;
//using OrchardCore.Data;
using Ruitu.Edu.TrainingDemo.Migrations;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.ContentDisplay;

namespace Ruitu.Edu.TrainingDemo
{
    public class Startup : StartupBase
    {
        public override void ConfigureServices(IServiceCollection services)
        {
            // 注册 Book 相关的服务注册
            services.AddScoped<IDisplayDriver<Book>, BookDisplayDriver>();
            services.AddScoped<IDisplayManager<Book>, DisplayManager<Book>>();

            services.AddIndexProvider<BookIndexProvider>();
            services.AddDataMigration<BookMigrations>();

            // PersonPart 相关的服务注册
            services.AddScoped<IDisplayManager<PersonPart>, DisplayManager<PersonPart>>();

            services.AddContentPart<PersonPart>()
                .UseDisplayDriver<PersonPartDisplayDriver>();
            services.AddIndexProvider<PersonPartIndexProvider>();
            services.AddDataMigration<PersonMigrations>();

        }
    }
}
